﻿<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/Site.Master" Inherits="System.Web.Mvc.ViewPage<BizCollegeWebApp.Models.CourseContent>" %>

<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
    EditSection
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    <h2>
        EditSection</h2>
    <script src="<%: Url.Content("~/Scripts/jquery.validate.min.js") %>" type="text/javascript"></script>
    <script src="<%: Url.Content("~/Scripts/jquery.validate.unobtrusive.min.js") %>"
        type="text/javascript"></script>
    <table class="courseViewTable" cellpadding="0" cellspacing="0">
        <tr>
            <td style="width: 20%; vertical-align: top;">
                <% Html.RenderPartial("CourseEditSectionMenu", Model.Course); %>
            </td>
            <td style="width: 80%">
                <form action="" method="post" enctype="multipart/form-data">
                <%: Html.ValidationSummary(true)%>
                <%: Html.ValidationMessage("ex")%>
                <fieldset>
                    <legend>Update Section Content</legend>
                    <%: Html.HiddenFor(model => model.ContentID)%>
                    <%: Html.HiddenFor(model => model.CourseID)%>
                    <div class="editor-label">
                        Section Name:
                    </div>
                    <div class="editor-field">
                        <%: Html.TextBoxFor(model => model.SectionName, new { @class = "longTextField" })%>
                        <%: Html.ValidationMessageFor(model => model.SectionName)%>
                    </div>
                    <div class="editor-label">
                        Section Summary:
                    </div>
                    <div class="editor-field">
                        <%: Html.TextArea("SectionDescription", Model.SectionDescription, new { @class = "cdTextArea" })%>
                        <%: Html.ValidationMessageFor(model => model.SectionDescription)%>
                    </div>
                    <div class="editor-label">
                        Current content:
                    </div>
                    <div>
                        <%: Html.ActionLink(Model.FileName, "Download", new{ id = Model.ContentID}) %>
                    </div>
                    <div class="editor-label">
                        Upload the content (to replace the current file):
                    </div>
                    <div class="editor-field">
                        <input type="file" name="file" id="file" />
                        <%: Html.ValidationMessage("file")%>
                    </div>
                    <p>
                        <%: Html.ActionLink("Discard the changes", "Index")%>
                        <input type="submit" value="Save and continue" />
                    </p>
                </fieldset>
                </form>
            </td>
        </tr>
    </table>
</asp:Content>
